<template>
	<view class="page">
		<view class="section margin-bottom-default"  v-for="(item, index) in cashList">
			<view class="flex padding-m ">
				<view class="flex-3">{{item.name}}</view>
				<view>{{numFilter(item.value)}}</view>
			</view>
		</view>
	</view>
</template>

<script>
import home from '../../js/api/home'
	export default {
		data() {
			return {
				cashList: []
			}
		},
		onLoad() {
			this.loadCash()
		},
		methods: {
			numFilter(value) {
				let realVal = parseFloat(value ? value : 0).toFixed(2)
				return realVal
			},
			loadCash() {
				home.cash().then((res) => {
					this.cashList =res
				})
			},
		}
	}
</script>

<style>

</style>